﻿namespace YunQue.WebApi.Common.Attributes
{
    /// <summary>
    /// 接口权限
    /// </summary>
    public class APIPermissionAttribute:Attribute
    {
        /// <summary>
        /// 权限
        /// </summary>
        public List<string> PermissionCodes { get; set; }
        /// <summary>
        /// 逻辑操作类型
        /// </summary>
        public OpreationType OpreationType { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="permissionCodes"></param>
        /// <param name="opreation"></param>
        public APIPermissionAttribute(string permissionCodes, OpreationType opreation= OpreationType.And)
        {
            PermissionCodes = permissionCodes?.Split(",").ToList();
            OpreationType = opreation;
        }
    }
}
